//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package study.IO.字符流;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;

public class GBK_UTF8 {
    public GBK_UTF8() {
    }

    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("JavaTest\\Files\\a-copy.txt", Charset.forName("GBK"));
        FileWriter fw = new FileWriter("JavaTest\\Files\\a-copy2.txt");
        char[] buf = new char[1024];

        int len;
        while((len = fr.read(buf)) != -1) {
            fw.write(buf, 0, len);
        }

        fr.close();
        fw.close();
    }
}
